import { ListViewAdapter } from "../../../../script/util/ListView/ListViewAdapter";
import { ccs } from "../../../../script/util/services";
import { WinBase } from "../../../../script/wins/WinBase";

const {ccclass, property} = cc._decorator;

@ccclass
export default class NewClass extends WinBase {
    
     
    @property(ListViewAdapter)
    list: ListViewAdapter = null;
    
    type: string = null;
    start () {
        this.registerEvent("updateAssets", () => {this.updateItems(this.type)});
    }
    updateItems(type) {
        this.type = type;
        let items = ccs.dataMgr.getAssetsByType(type);
        this.list.updateItems(items as any);
        this.list.handlerScroll();
    }
    onScroll() {
        this.list.handlerScroll();

    }
}
